<?php

declare(strict_types=1);

namespace App\User\Model;

use Mine\MineModel;

/**
 * @property int $id ID
 * @property int $user_id 用户id
 * @property int $product_id 产品id
 * @property string $product_name 产品名称
 * @property int $price 产品价格
 * @property string $product_img 产品图片
 * @property string $extend_field 扩展字段
 * @property int $source_type 背包产品来源
 * @property int $source_id 来源对应id
 * @property int $status 0 入库,1 已兑换,2 已提取,3提取中,4充能消耗,5熔炼消耗,6升级消耗
 * @property int $gid dtm事务
 * @property int $created_by 创建者
 * @property int $create_time 创建时间
 * @property int $update_time 更新时间
 */
class UserBag extends MineModel
{
    protected ?string $dateFormat = 'U';
    const CREATED_AT = 'create_time';
    const UPDATED_AT = 'update_time';
    /**
     * The table associated with the model.
     */
    protected ?string $table = 'user_bag';

    /**
     * The attributes that are mass assignable.
     */
    protected array $fillable = ['id', 'user_id', 'product_id', 'product_name', 'price', 'product_img', 'extend_field', 'source_type', 'source_id', 'status', 'gid', 'created_by', 'create_time', 'update_time'];

    /**
     * The attributes that should be cast to native types.
     */
    protected array $casts = ['id' => 'integer', 'user_id' => 'integer', 'product_id' => 'integer', 'price' => 'integer', 'source_type' => 'integer', 'source_id' => 'integer', 'status' => 'integer', 'gid' => 'integer', 'created_by' => 'integer', 'create_time' => 'integer', 'update_time' => 'integer'];
}
